package com.jason.base;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * author sj
 */

public interface BaseService<T> extends IService<T> {

    Page<T> selectPage(T entity);

    List<T> selectList(T entity);

    Page<T> getPageInfo(T model);

    Page<T> getPageInfo(int current, int size, String orderByField, boolean asc);

    EntityWrapper<T> getEntityWrapper(T model, EntityWrapper<T> entityWrapper);

    boolean insertOrUpdateBatch(List<T> entityList);

    boolean insertBatch(List<T> entityList);

    boolean insertWithUser(T model);

    boolean insertOrUpdateByUser(T t);

    boolean updateBatchById(List<T> entityList);

    boolean updateByUser(T model);

    T selectOne(T model);

    boolean deleteBatchIds(Collection<? extends Serializable> idList);

    boolean deleteBatchIdsByUser(List<T> list);

    boolean deleteByUser(T t);

    Long getCurrentUserId();

}
